package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterDashMyDashPageUtil extends SeleniumPageUtil {
	
	public final static By CQQ_DIV_RESULT = By.xpath("//*[@id='Quoter_QuoteList1_lblPaging']/div");
	public final static By CQQ_SPAN_ALL = By.xpath("//*[@id='Quoter_QuoteList1_lblPaging']/div/span[11]");
	public final static By CQQ_TD_TITLE = By.xpath("//*[@id='Quoter_QuoteList1_pnlPage']/table/tbody/tr/td[4]");
	public final static By CQQ_SPAN_TITLE = By.id("Quoter_QuoteList1_lblScope");
	
	public final static By CQQ_FILTER_CONTRACT_ID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]/div/img");
	public final static By CQQ_FILTER_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]/div/img");
	public final static By CQQ_FILTER_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/div/img");
	public final static By CQQ_FILTER_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/div/img");
	public final static By CQQ_FILTER_CREATEBY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/div/img");
	public final static By CQQ_FILTER_CREATED = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/div/img");
	public final static By CQQ_FILTER_SALESREP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/div/img");
	
	public final static By CQQ_LINK_CONTRACT_ID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]/a");
	public final static By CQQ_LINK_REVISION = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]/a");
	public final static By CQQ_LINK_SUBVER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[3]/a");
	public final static By CQQ_LINK_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]/a");
	public final static By CQQ_LINK_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/a");
	public final static By CQQ_LINK_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/a");
	public final static By CQQ_LINK_CREATEBY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/a");
	public final static By CQQ_LINK_CREATED = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/a");
	public final static By CQQ_LINK_SALESREP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/a");
	public final static By CQQ_LINK_ROUGH_MMC = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/a");
	public final static By CQQ_LINK_LINES = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[11]/a");
	public final static By CQQ_LINK_DISCREPS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]/a");
	public final static By CQQ_LINK_ERRORS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]/a");
	public final static By CQQ_LINK_WARNINGS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[14]/a");
	public final static By CQQ_UNIQUECONFIGS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]/a");
	public final static By CQQ_LINK_SIGNOFF = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[16]/a");
	
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH_MYBOARD});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_DASH_MYBOARD));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQQ_TD_TITLE,CQQ_LINK_SIGNOFF,CQQ_UNIQUECONFIGS
		});
	}
}
